﻿using System;
using System.Data;
using System.Runtime.Serialization;
using System.ServiceModel;

namespace HRMService
{
    // NOTE: If you change the interface name "IVisa" here, you must also update the reference to "IVisa" in App.config.
    [ServiceContract(Namespace = "http://HRMService")]
    public interface IVisa
    {
        [OperationContract]
        DataSet Visa_GetAll();

        [OperationContract]
        VisaInfo Visa_GetInfo(int VisaID);

        [OperationContract]
        DataSet Visa_GetList(out int ItemCount, int currentPage, int pageSize);

        [OperationContract]
        DataSet Visa_GetWithEmployee(int EmployeeID);

        [OperationContract]
        int Visa_Insert(VisaInfo eInfo);

        [OperationContract]
        bool Visa_Update(VisaInfo eInfo);
        
        [OperationContract]
        bool Visa_Delete(int VisaID);
    }

    [DataContract(Namespace = "http://HRMService")]
    public class VisaInfo
    {
        int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }

        int _EmployeeID;
        [DataMember]
        public int EmployeeID
        {
            get { return _EmployeeID; }
            set { _EmployeeID = value; }
        }

        string _No;
        [DataMember]
        public string No
        {
            get { return _No; }
            set { _No = value; }
        }

        DateTime _IssueDate;
        [DataMember]
        public DateTime IssueDate
        {
            get { return _IssueDate; }
            set { _IssueDate = value; }
        }

        DateTime _ExpireDate;
        [DataMember]
        public DateTime ExpireDate
        {
            get { return _ExpireDate; }
            set { _ExpireDate = value; }
        }

        string _AuthorIssue;
        [DataMember]
        public string AuthorIssue
        {
            get { return _AuthorIssue; }
            set { _AuthorIssue = value; }
        }
    }
}
